package rest.feign;

import feign.Headers;
import feign.Param;
import feign.RequestLine;
import org.springframework.web.bind.annotation.RequestParam;
import rest.entity.Result;
import rest.entity.User;

import java.util.List;
import java.util.Map;

public interface SpringbootClient {


    @RequestLine("POST /xmlUser")
    @Headers("Content-Type: application/xml") //注意：冒号后面要有空格！！
    Result xmlUser(User user);
//    Result xmlUser(Member user);


    @RequestLine("POST /jsonUser")
    @Headers("Content-Type: application/json")
    User jsonUser(User user);

    @RequestLine("POST /stringUser")
//    @Headers("Content-Type: application/x-www-form-urlencoded")
    String stringUser(@RequestParam(value = "user")String user);

    @RequestLine("POST /jsonUserToString")
    @Headers("Content-Type: application/json")
    User jsonUserToString(User user);

    @Headers("Content-Type: application/json")
    @RequestLine("POST /getUser")
    User getUser(@RequestParam(value = "userId")String userId);

//    @Headers("Content-Type: application/json")
    @RequestLine("POST /getUsers")
    @Headers("Content-Type: text/html")
    Map<String,User> getUsers(@RequestParam(value = "userId")String userId);
}
